#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<math.h>
using namespace std;

class Solution {
public:
    bool check(int n)
    {
        int prev = n % 10;
        n /= 10;
        while (n > 0)
        {
            int cur = n % 10;
            n /= 10;
            if (cur > prev) return false;
            prev = cur;
        }
        return true;
    }
    int monotoneIncreasingDigits(int n) {
        string s = to_string(n);
        int i = 0,len=s.size();
        while(i<len-1)
        {
            if (s[i] > s[i + 1])
            {
                while (i > 0 && s[i] == s[i - 1]) --i;
                s[i] -= 1;
                for (i = i + 1; i < len; ++i)
                {
                    s[i] = '9';
                }
                return stoi(s);
            }
            ++i;
        }
        return n;
    }

    int brokenCalc(int startValue, int target) {
        int step = 0;
        while (startValue < target)
        {
            ++step;
            if (target & 1) ++target;
            else
            {
                if (startValue >= target) ++target;
                else target /= 2;
            }
        }
        return step;
    }

    int brokenCalc(int startValue, int target) {
        int step = 0;
        while (startValue < target)
        {
            ++step;
            if (target & 1) ++target;
            else target /= 2;
        }
        return step + startValue - target;
    }

    int eraseOverlapIntervals(vector<vector<int>>& intervals) {
        sort(intervals.begin(), intervals.end(), [](const vector<int>& v1, const vector<int>& v2)
            {
                return v1[0] < v2[0];
            });
        int right = intervals[0][1], ans = 0;;
        for (int i = 1; i < intervals.size(); ++i)
        {
            if (intervals[i][0] < right)
            {
                ++ans;
                right = min(right, intervals[i][1]);
            }
            else
            {
                right = intervals[i][1];
            }
        }
        return ans;
    }

    vector<vector<int>> merge(vector<vector<int>>& intervals) {
        sort(intervals.begin(), intervals.end());
        vector<vector<int>> ret;
        int left = intervals[0][0], right = intervals[0][1];
        for (int i = 1; i < intervals.size(); ++i)
        {
            int a = intervals[i][0], b = intervals[i][1];
            if (a <= right)
            {
                right = max(right, b);
            }
            else
            {
                ret.push_back({ left,right });
                left = a;
                right = b;
            }
        }
        ret.push_back({ left,right });
        return ret;
    }

    int findMinArrowShots(vector<vector<int>>& points) {
        sort(points.begin(), points.end());
        int ret = 1;
        int right = points[0][1];
        for (int i = 1; i < points.size(); ++i)
        {
            int a = points[i][0], b = points[i][1];
            if (a <= right)
            {
                right = min(right, b);
            }
            else
            {
                ++ret;
                right = b;
            }
        }
        return ret;
    }

    unordered_map<int, int> memo;

    int dfs(long long n)
    {
        if (n == 1) return 0;
        if (memo.count(n)) return memo[n];

        if (!(n & 1))
        {
            memo[n] = dfs(n / 2) + 1;
            return memo[n];
        }
        else
        {
            memo[n] = min(dfs(n + 1), dfs(n - 1)) + 1;
            return memo[n];
        }
    }

    int dfs(long long n)
    {
        if (n == 1) return 0;

        if (!(n & 1)) return dfs(n / 2) + 1;
        else return min(dfs(n + 1), dfs(n - 1)) + 1;
    }

    int integerReplacement(int n) {
        return dfs(n);
    }


    int find(const vector<int>& nums, int n)
    {
        int left = 0, right = nums.size() - 1;
        while (left < right)
        {
            int mid = (left + right) >> 1;
            if (nums[mid] >= n) right = mid;
            else left = mid + 1;
        }
        return left;
    }

    int maxEnvelopes(vector<vector<int>>& envelopes) {
        int n = envelopes.size();
        sort(envelopes.begin(), envelopes.end(), [&](const vector<int>& v1, const vector<int>& v2)
            {
                return v1[0] < v2[0] || (v1[0] == v2[0] && v1[1] > v2[1]);
            });
        vector<int> ret;
        ret.push_back(envelopes[0][1]);
        for (int i = 0; i < n; ++i)
        {
            int b = envelopes[i][1];
            if (b > ret.back()) ret.push_back(b);
            else
            {
                int index = find(ret, b);
                ret[index] = b;
            }
        }
        return ret.size();
    }

    int pileBox(vector<vector<int>>& box) {
        int n = box.size();
        sort(box.begin(), box.end());
        vector<int> dp(n);
        for (int i = 0; i < n; ++i)
            dp[i] = box[i][2];
        int ret = 0;
        for (int i = 0; i < n; ++i)
        {
            int x = box[i][0], y = box[i][1], z = box[i][2];
            for (int j = 0; j < i; ++j)
            {
                int a = box[j][0], b = box[j][1], c = box[j][2];
                if (x > a && y > b && z > c) dp[i] = max(dp[i], dp[j] + box[i][2]);
            }
            ret = max(ret, dp[i]);
        }
        return ret;
    }

    int maxSumDivThree(vector<int>& nums) {
        const int INF = 0x3f3f3f3f;
        int sum = 0;
        int x1 = INF, x2 = INF, y1 = INF, y2 = INF;
        for (int x : nums)
        {
            sum += x;
            if (x % 3 == 1)
            {
                if (x < x1) x2 = x1, x1 = x;
                else if (x < x2) x2 = x;
            }
            else if (x % 3 == 2)
            {
                if (x < y1) y2 = y1, y1 = x;
                else if (x < y2) y2 = x;
            }
        }
        if (sum % 3 == 0) return sum;
        else if (sum % 3 == 1) return max(sum - y1 - y2, sum - x1);
        else return max(sum - x1 - x2, sum - y1);
    }

    vector<int> rearrangeBarcodes(vector<int>& barcodes) {
        int n = barcodes.size();
        unordered_map<int, int> hash;
        vector<int> ret(n);
        int x = 0, cnt = 0;
        for (int num : barcodes)
        {
            ++hash[num];
            if (hash[num] > cnt)
            {
                x = num;
                cnt = hash[num];
            }
        }
        int index = 0;
        for (int i = 0; i < cnt; ++i)
        {
            ret[index] = x;
            index += 2;
        }
        hash.erase(x);
        for (auto& [k, v] : hash)
        {
            for (int i = 0; i < v; ++i)
            {
                if (index >= n) index = 1;
                ret[index] = k;
                index += 2;
            }
        }
        return ret;
    }

    string reorganizeString(string s) {
        int n = s.size();
        unordered_map<int, int> hash;
        char maxChar = 0;
        int maxCnt = 0;
        for (char c : s)
        {
            if (++hash[c] > maxCnt)
            {
                maxCnt = hash[c];
                maxChar = c;
            }
        }
        if (maxCnt > (n + 1) / 2) return "";
        int index = 0;
        string ret(n, ' ');
        for (int i = 0; i < maxCnt; ++i)
        {
            ret[index] = maxChar;
            index += 2;
        }
        hash.erase(maxChar);
        for (auto& [k, v] : hash)
        {
            while (v--)
            {
                if (index >= n) index = 1;
                ret[index] = k;
                index += 2;
            }
        }
        return ret;
    }

    int n, c, x[100005];

    bool check(int dis)
    {
        int cnt = 1, place = 0;
        for (int i = 0; i < n; ++i)
        {
            if (x[i] - x[place] >= dis)
            {
                ++cnt;
                place = i;
            }
        }
        if (cnt >= c) return true;
        return false;
    }

    /*int main()
    {
        cin >> n >> c;
        int mx = 0;
        for (int i = 0; i < n; ++i)
        {
            cin >> x[i];
            mx = max(mx, x[i]);
        }
        sort(x, x + n);
        int left = 0, right = mx, ans;
        while (left < right)
        {
            int mid = (left + right) >> 1;
            if (check(mid))
            {
                ans = mid;
                left = mid + 1;
            }
            else right = mid;
        }
        cout << ans;
        return 0;
    }*/

   /* const int N = 1e4 + 10;
    int a[N], b[N], c[N][2], t, k;;

    bool check(int p)
    {
        int cur = 1;
        memset(b, 0, sizeof b);
        for (int i = 1; i <= t; ++i)
        {
            if (b[cur] + a[i] > p)
            {
                cur++;
            }
            b[cur] += a[i];
        }
        if (cur > k) return false;
        else return true;
    }

    void print(int p)
    {
        int cur = k, tmp = 0;
        for (int i = t; i > 0; --i)
        {
            if (!c[cur][1])
            {
                c[cur][1] = i;
            }
            if (tmp + a[i] > p)
            {
                c[cur][0] = i + 1;
                tmp = a[i];
                cur--;
                c[cur][1] = i;
            }
            else tmp += a[i];
        }
        c[cur][0] = 1;
        for (int i = 1; i <= k; ++i)
        {
            cout << c[i][0] << " " << c[i][1] << endl;
        }
    }

    int main()
    {

        cin >> t >> k;
        int right = 0, left = 0;
        for (int i = 1; i <= t; ++i)
        {
            cin >> a[i];
            left = max(left, a[i]);
            right += a[i];
        }
        int ans = 0;
        while (left < right)
        {
            int mid = (left + right) >> 1;
            if (check(mid))
            {
                right = mid;
            }
            else left = mid + 1;
        }
        print(left);
        return 0;
    }*/

    /*int e[10][5];
    int cnt[5] = { 0,2,6,10,14 };
    char c[10] = "#spdf";

    void dfs(int x, int i, int j)
    {
        e[i][j] = min(cnt[j], x);
        int y = x - cnt[j];
        if (y <= 0) return;
        if (j == 1)
        {
            j = i / 2 + 1;
            i = (i + 1) / 2 + 1;
        }
        else
        {
            ++i, --j;
        }
        dfs(y, i, j);
    }

    int main()
    {
        int n;
        cin >> n;
        dfs(n, 1, 1);
        for (int i = 1; i < 10; ++i)
        {
            for (int j = 1; j < 5; ++j)
            {
                if (e[i][j]) cout << i << c[j] << e[i][j] << " ";
            }
            cout << endl;
        }
        return 0;
    }*/
};

#include<iostream>
#include<math.h>
using namespace std;

#define eps 1e-5
double PI = acos(-1.0);
double area[10010];
int n, m;

bool check(double x)
{
    int sum = 0;
    for (int i = 0; i < n; ++i)
    {
        sum += (int)(area[i] / x);
    }
    if (sum >= m) return true;
    else return false;
}

int main()
{
    int z = 0;
    cin >> z;
    while (z--)
    {
        cin >> n >> m;
        ++m;
        double maxSize=0;
        for (int i = 0; i < n; ++i)
        {
            int r;
            cin >> r;
            area[i] = PI * r * r;
            maxSize = max(maxSize, area[i]);
        }
        double left = 0, right = maxSize;
        while (right - left > eps)
        {
            double mid = left+(right-left)/2;
            if (check(mid)) left = mid;
            else right = mid;
        }
        printf("%.4f\n", left);
    }
    return 0;
}